package cn.e3mall.service.message;

import java.util.Arrays;
import java.util.List;

import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import org.apache.solr.client.solrj.SolrServer;
import org.springframework.beans.factory.annotation.Autowired;

public class ItemDelMessageListener implements MessageListener{

	@Autowired
	private SolrServer solrServer;
	
	@Override
	public void onMessage(Message message) {
		TextMessage textMessage = (TextMessage) message;
		try {
			String id = textMessage.getText();
			System.out.println("id="+id);
//			List<String> ids = Arrays.asList(id);
//			solrServer.deleteById(ids);
//			solrServer.commit();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
